package com.mini.admin.openfeign.controller;

import com.mini.admin.api.entity.SysUser;
import com.mini.admin.api.openfeign.AdminUserOpen;
import com.mini.admin.service.SysUserService;
import com.mini.common.core.result.RestResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Zhou Feng
 */
@RestController
public class AdminUserOpenController implements AdminUserOpen {
    @Autowired
    private SysUserService sysUserService;

    @Override
    public RestResponse<SysUser> getUserByUsername(@RequestParam("username") String username) {
        return RestResponse.ok(sysUserService.getUserByUsername(username));
    }

    @Override
    public RestResponse<SysUser> getUserByMobile(@RequestParam("mobile") String mobile) {
        return RestResponse.ok(sysUserService.getUserByMobile(mobile));
    }
}
